
#ifndef __MODELLOADER_H__
#define __MODELLOADER_H__


#include <windows.h>
#include "basetype.h"

#include "MathDef.h"
#include "3dModelDef.h"
#include "Vector.h"
#include "Obj4d.h"
#include "Obj4dV2.h"
#include "DxDrawEnv.h"


#define VERTEX_FLAGS_INVERT_X               0x0001   // inverts the Z-coordinates
#define VERTEX_FLAGS_INVERT_Y               0x0002   // inverts the Z-coordinates
#define VERTEX_FLAGS_INVERT_Z               0x0004   // inverts the Z-coordinates
#define VERTEX_FLAGS_SWAP_YZ                0x0008   // transforms a RHS model to a LHS model
#define VERTEX_FLAGS_SWAP_XZ                0x0010   
#define VERTEX_FLAGS_SWAP_XY                0x0020
#define VERTEX_FLAGS_INVERT_WINDING_ORDER   0x0040   // invert winding order from cw to ccw or ccw to cc


#define VERTEX_FLAGS_TRANSFORM_LOCAL        0x0200   // if file format has local transform then do it!
#define VERTEX_FLAGS_TRANSFORM_LOCAL_WORLD  0x0400  // if file format has local to world then do it!


class CModelLoader
{
public:

	CModelLoader()
	{

	}
	
	virtual ~CModelLoader()
	{

	}

	int Init(TCHAR* pFile, PDxDrawEnv pDxDrawEnv = NULL)
	{
		m_strFile		= pFile;
		m_pDxDrawEnv	= pDxDrawEnv;

		return 0;
	}

	virtual int LoadObject(CObj4d&		obj,		// pointer to object
							CVector4d*	pScale,		// initial scaling factors
							CVector4d*	pPos,		// initial position
							CVector4d*	pRot,		// initial rotations
							int			vertex_flags = 0)
	{
		return 0;
	}

	virtual int LoadObject(CObj4dV2&	obj,		// pointer to object
							CVector4d*	pScale,		// initial scaling factors
							CVector4d*	pPos,		// initial position
							CVector4d*	pRot,		// initial rotations
							int			vertex_flags = 0)
	{
		return 0;
	}


protected:

	PDxDrawEnv		m_pDxDrawEnv;
	tstring			m_strFile;
};

#endif